﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Desktop.aspx.cs" Inherits="WorkFlow.web.Desktop" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="Style/Desktop.css" rel="stylesheet" />
    <script src="JS/Utilities.js"></script>
    <script>
        function $ID(ele) {
            return document.getElementById(ele);
        }
        function constructMenus() {
            var html = ns.ConstructMenus().value;
            $ID("div_id_menu").innerHTML = html;
        }
        addLoadFuc(constructMenus);
        addLoadFuc(actRequest);
        //每隔n秒扫描向服务器请求一次 查看是否有新活动
        function actRequest() {
            $ID("userid").innerHTML = "用户:" + ns.getUserID().value;
            //getUserID
            //     setInterval(requestAct, 5000);
        }
        function requestAct() {
            var newActCount = ns.actRequest().value;
            if (newActCount == null || newActCount == 0) {
                $ID("newMsgAlert").innerHTML = "没有新消息!";
            } else {
                $ID("newMsgAlert").innerHTML = "有" + newActCount + "条新消息!";
            }
        }
        //但用户点击"有xx条新消息时,跳转的通知页面
        function toNotificationPanel() {
            $ID("right").setAttribute("src", "NotificationPanel.aspx");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div style="position: relative;">
            <div style="top: 0px; left: 0px; width: 1305px; height: 30px; background-color: #8abbc8;">
                <label id="newMsgAlert" onclick="toNotificationPanel()"></label>
                <label id="userid"></label>
                <input type="button" value="退出" onclick="logout()" />
            </div>
            <div id="div_id_menu" class="menu">
            </div>
            <div class="main_panel">
                <iframe src="NotificationPanel.aspx" name="right" id="right"></iframe>
            </div>
        </div>
    </form>
    <script>
        function logout() {
            ns.ReLogin();
            window.location.href = "login.aspx";
        }
    </script>
</body>
</html>